<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>书籍列表</title>
        <link rel="stylesheet" href="../../layui/css/layui.css">
        <script src="../../layui/layui.js"></script>
    </head>
    <body>
        <div class="layui-container" style="margin-top: 50px ">
            <h2 style="text-align: center;">书籍列表</h2>

            <a href="/book/toAddBook" class="layui-btn" style="margin-top: 20px">添加</a>
            <table class="layui-table">
                <colgroup>
                    <col width="150">
                    <col width="200">
                    <col>
                </colgroup>
                <thead>
                <tr>
                    <th>书籍编号</th>
                    <th>名称</th>
                    <th>类别</th>
                    <th>剩余数量</th>
                    <th>详情</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="book,bookStat:${books}">
                    <td th:text="${book.bookID}"></td>
                    <td th:text="${book.bookName}"></td>
                    <td th:text="${book.bookCategory}"></td>
                    <td th:text="${book.bookCounts}"></td>
                    <td th:text="${book.detail}"></td>
                    <td style="text-align: center">
                        <a th:href="@{'/book/toUpdateBook?bookID='+${book.bookID}}"class="layui-btn">修改</a>
                        <a th:href="@{'/book/deleteBook?bookID='+${book.bookID}}"class="layui-btn">删除</a>
                        <!--<a href="/book/toUpdateBook?" class="layui-btn" >修改</a>-->
                    </td>

                </tr>
                </tbody>
            </table>
        </div>
    </body>
</html>